package com.batchOperation.boot;

import com.batchOperation.excel.executor.ExecutorInfo;
import com.batchOperation.excel.executor.ExecutorStrategy;
import com.batchOperation.excel.executor.IExecutor;
import com.batchOperation.tool.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Package: com.batchOperation.boot
 * @ClassName: BatchOperatorService
 * @Author: wulongkai
 * @CreateTime: 2024/7/19 11:36
 * @Description: 集成服务
 */
@Slf4j
@Service
public class BatchOperatorBootService {

    @Autowired
    private ExecutorStrategy executorStrategy;

    public Response parseFile(ExecutorInfo executorInfo) {
        final IExecutor executor = executorStrategy.getExecutor(executorInfo.getMainObj());
        executor.execute(executorInfo);
        return Response.getSuccessResult();
    }
}
